<template>
	<view class="">
		<button open-type="chooseAvatar" @chooseavatar="handleAvatar">选择图片（获取微信头像）</button>
		<view >输入框获取微信昵称</view>
		<input type="nickname" />
		<button @click="handleLogin">登录</button>
		<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">申请获取手机号</button>
	</view>
</template>

<script>
	export default {
		methods:{
			handleLogin(){
				this.$WX.login().then(res=>{
					console.log(res)
				})
			},
			handleAvatar(e){
				console.log(e.detail.avatarUrl)
			},
			getPhoneNumber(e){
				let code = e.detail.code;
				//然后通过接口换取phone
			}
		}
	}
</script>

<style>
	
</style>